<html>
<head>
<title>File Source for Worksheet.php</title>
<link rel="stylesheet" type="text/css" href="../media/style.css">
</head>
<body>

<table border="0" cellspacing="0" cellpadding="0" height="48" width="100%">
  <tr>
    <td class="header_top">PHPExcel_Writer_Excel2007</td>
  </tr>
  <tr><td class="header_line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
  <tr>
    <td class="header_menu">
  		  [ <a href="../classtrees_PHPExcel_Writer_Excel2007.html" class="menu">class tree: PHPExcel_Writer_Excel2007</a> ]
		  [ <a href="../elementindex_PHPExcel_Writer_Excel2007.html" class="menu">index: PHPExcel_Writer_Excel2007</a> ]
		  [ <a href="../elementindex.html" class="menu">all elements</a> ]
    </td>
  </tr>
  <tr><td class="header_line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="200" class="menu">
      <b>Packages:</b><br />
              <a href="../li_PHPExcel.html">PHPExcel</a><br />
              <a href="../li_PHPExcel_Cell.html">PHPExcel_Cell</a><br />
              <a href="../li_PHPExcel_Reader.html">PHPExcel_Reader</a><br />
              <a href="../li_PHPExcel_Shared.html">PHPExcel_Shared</a><br />
              <a href="../li_PHPExcel_Style.html">PHPExcel_Style</a><br />
              <a href="../li_PHPExcel_Worksheet.html">PHPExcel_Worksheet</a><br />
              <a href="../li_PHPExcel_Worksheet_Drawing.html">PHPExcel_Worksheet_Drawing</a><br />
              <a href="../li_PHPExcel_Writer.html">PHPExcel_Writer</a><br />
              <a href="../li_PHPExcel_Writer_Excel2007.html">PHPExcel_Writer_Excel2007</a><br />
            <br /><br />
                  
                </td>
    <td>
      <table cellpadding="10" cellspacing="0" width="100%" border="0"><tr><td valign="top">

<h1 align="center">Source for file Worksheet.php</h1>
<p>Documentation is available at <a href="../PHPExcel_Writer_Excel2007/_Classes_PHPExcel_Writer_Excel2007_Worksheet_php.html">Worksheet.php</a></p>
<div class="php">
<div class="listing"><pre><ol><li><a name="a1"></a><span class="src-php">&lt;?php</span></li>
<li><a name="a2"></a><span class="src-doc">/**</span></li>
<li><a name="a3"></a><span class="src-doc"> * PHPExcel</span></li>
<li><a name="a4"></a><span class="src-doc"> *</span></li>
<li><a name="a5"></a><span class="src-doc"> * Copyright (c) 2006 - 2007 PHPExcel, Maarten Balliauw</span></li>
<li><a name="a6"></a><span class="src-doc"> *</span></li>
<li><a name="a7"></a><span class="src-doc"> * This library is free software; you can redistribute it and/or</span></li>
<li><a name="a8"></a><span class="src-doc"> * modify it under the terms of the GNU Lesser General Public</span></li>
<li><a name="a9"></a><span class="src-doc"> * License as published by the Free Software Foundation; either</span></li>
<li><a name="a10"></a><span class="src-doc"> * version 2.1 of the License, or (at your option) any later version.</span></li>
<li><a name="a11"></a><span class="src-doc"> * </span></li>
<li><a name="a12"></a><span class="src-doc"> * This library is distributed in the hope that it will be useful,</span></li>
<li><a name="a13"></a><span class="src-doc"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></li>
<li><a name="a14"></a><span class="src-doc"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU</span></li>
<li><a name="a15"></a><span class="src-doc"> * Lesser General Public License for more details.</span></li>
<li><a name="a16"></a><span class="src-doc"> * </span></li>
<li><a name="a17"></a><span class="src-doc"> * You should have received a copy of the GNU Lesser General Public</span></li>
<li><a name="a18"></a><span class="src-doc"> * License along with this library; if not, write to the Free Software</span></li>
<li><a name="a19"></a><span class="src-doc"> * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA</span></li>
<li><a name="a20"></a><span class="src-doc"> *</span></li>
<li><a name="a21"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@category</span><span class="src-doc">   PHPExcel</span></li>
<li><a name="a22"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@package</span><span class="src-doc">    PHPExcel_Writer_Excel2007</span></li>
<li><a name="a23"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@copyright</span><span class="src-doc">  Copyright (c) 2006 - 2007 PHPExcel (http://www.codeplex.com/PHPExcel)</span></li>
<li><a name="a24"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@license</span><span class="src-doc">    http://www.gnu.org/licenses/lgpl.txt    LGPL</span></li>
<li><a name="a25"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@version</span><span class="src-doc">    ##VERSION##, ##DATE##</span></li>
<li><a name="a26"></a><span class="src-doc"> */</span></li>
<li><a name="a27"></a>&nbsp;</li>
<li><a name="a28"></a>&nbsp;</li>
<li><a name="a29"></a><span class="src-doc">/** PHPExcel_Writer_Excel2007 */</span></li>
<li><a name="a29"></a>&nbsp;</li>
<li><a name="a30"></a><span class="src-inc">require_once </span><span class="src-str">'PHPExcel/Writer/Excel2007.php'</span><span class="src-sym">;</span></li>
<li><a name="a31"></a>&nbsp;</li>
<li><a name="a32"></a><span class="src-doc">/** PHPExcel_Writer_Excel2007_WriterPart */</span></li>
<li><a name="a32"></a>&nbsp;</li>
<li><a name="a33"></a><span class="src-inc">require_once </span><span class="src-str">'PHPExcel/Writer/Excel2007/WriterPart.php'</span><span class="src-sym">;</span></li>
<li><a name="a34"></a>&nbsp;</li>
<li><a name="a35"></a><span class="src-doc">/** PHPExcel_Cell */</span></li>
<li><a name="a35"></a>&nbsp;</li>
<li><a name="a36"></a><span class="src-inc">require_once </span><span class="src-str">'PHPExcel/Cell.php'</span><span class="src-sym">;</span></li>
<li><a name="a37"></a>&nbsp;</li>
<li><a name="a38"></a>&nbsp;</li>
<li><a name="a39"></a><span class="src-doc">/**</span></li>
<li><a name="a40"></a><span class="src-doc"> * PHPExcel_Writer_Excel2007_Worksheet</span></li>
<li><a name="a41"></a><span class="src-doc"> *</span></li>
<li><a name="a42"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@category</span><span class="src-doc">   PHPExcel</span></li>
<li><a name="a43"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@package</span><span class="src-doc">    PHPExcel_Writer_Excel2007</span></li>
<li><a name="a44"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@copyright</span><span class="src-doc">  Copyright (c) 2006 - 2007 PHPExcel (http://www.codeplex.com/PHPExcel)</span></li>
<li><a name="a45"></a><span class="src-doc"> */</span></li>
<li><a name="a46"></a><span class="src-key">class </span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_Worksheet.html">PHPExcel_Writer_Excel2007_Worksheet</a> <span class="src-key">extends </span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_WriterPart.html">PHPExcel_Writer_Excel2007_WriterPart</a></li>
<li><a name="a47"></a><span class="src-sym">{</span></li>
<li><a name="a48"></a>    <span class="src-doc">/**</span></li>
<li><a name="a49"></a><span class="src-doc">     * Write worksheet to XML format</span></li>
<li><a name="a50"></a><span class="src-doc">     *</span></li>
<li><a name="a51"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">    </span><span class="src-doc-type">PHPExcel_Worksheet </span><span class="src-doc">    </span><span class="src-doc-var">$pSheet </span></li>
<li><a name="a52"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">    </span><span class="src-doc-type">string[] </span><span class="src-doc">                </span><span class="src-doc-var">$pStringTable </span></li>
<li><a name="a53"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@return </span><span class="src-doc">    </span><span class="src-doc-type">string </span><span class="src-doc">                    XML Output</span></li>
<li><a name="a54"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@throws</span><span class="src-doc">     Exception</span></li>
<li><a name="a55"></a><span class="src-doc">     */</span></li>
<li><a name="a56"></a>    <span class="src-key">public </span><span class="src-key">function </span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_Worksheet.html#methodwriteWorksheet">writeWorksheet</a><span class="src-sym">(</span><span class="src-var">$pSheet </span>= <span class="src-id">null</span><span class="src-sym">, </span><span class="src-var">$pStringTable </span>= <span class="src-id">null</span><span class="src-sym">)</span></li>
<li><a name="a57"></a>    <span class="src-sym">{</span></li>
<li><a name="a58"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$pSheet</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a59"></a>            <span class="src-comm">// Create XML writer</span></li>
<li><a name="a60"></a>            <span class="src-var">$objWriter </span>= <span class="src-key">new </span><span class="src-id">xmlWriter</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a61"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">openMemory</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a62"></a>            </li>
<li><a name="a63"></a>            <span class="src-comm">// XML header</span></li>
<li><a name="a64"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">startDocument</span><span class="src-sym">(</span><span class="src-str">'1.0'</span><span class="src-sym">,</span><span class="src-str">'UTF-8'</span><span class="src-sym">,</span><span class="src-str">'yes'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a65"></a>            </li>
<li><a name="a66"></a>            <span class="src-comm">// Worksheet</span></li>
<li><a name="a67"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">startElement</span><span class="src-sym">(</span><span class="src-str">'worksheet'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a68"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'xml:space'</span><span class="src-sym">, </span><span class="src-str">'preserve'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a69"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'xmlns'</span><span class="src-sym">, </span><span class="src-str">'http://schemas.openxmlformats.org/spreadsheetml/2006/main'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a70"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'xmlns:r'</span><span class="src-sym">, </span><span class="src-str">'http://schemas.openxmlformats.org/officeDocument/2006/relationships'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a71"></a>            </li>
<li><a name="a72"></a>                <span class="src-comm">// sheetPr</span></li>
<li><a name="a73"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_Worksheet.html#method_writeSheetPr">_writeSheetPr</a><span class="src-sym">(</span><span class="src-var">$objWriter</span><span class="src-sym">, </span><span class="src-var">$pSheet</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a74"></a>            </li>
<li><a name="a75"></a>                <span class="src-comm">// Dimension</span></li>
<li><a name="a76"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_Worksheet.html#method_writeDimension">_writeDimension</a><span class="src-sym">(</span><span class="src-var">$objWriter</span><span class="src-sym">, </span><span class="src-var">$pSheet</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a77"></a>                </li>
<li><a name="a78"></a>                <span class="src-comm">// sheetViews</span></li>
<li><a name="a79"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_Worksheet.html#method_writeSheetViews">_writeSheetViews</a><span class="src-sym">(</span><span class="src-var">$objWriter</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a80"></a>            </li>
<li><a name="a81"></a>                <span class="src-comm">// sheetFormatPr</span></li>
<li><a name="a82"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_Worksheet.html#method_writeSheetFormatPr">_writeSheetFormatPr</a><span class="src-sym">(</span><span class="src-var">$objWriter</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a83"></a>                </li>
<li><a name="a84"></a>                <span class="src-comm">// cols</span></li>
<li><a name="a85"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_Worksheet.html#method_writeCols">_writeCols</a><span class="src-sym">(</span><span class="src-var">$objWriter</span><span class="src-sym">, </span><span class="src-var">$pSheet</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a86"></a>                        </li>
<li><a name="a87"></a>                <span class="src-comm">// sheetData</span></li>
<li><a name="a88"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_Worksheet.html#method_writeSheetData">_writeSheetData</a><span class="src-sym">(</span><span class="src-var">$objWriter</span><span class="src-sym">, </span><span class="src-var">$pSheet</span><span class="src-sym">, </span><span class="src-var">$pStringTable</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a89"></a>            </li>
<li><a name="a90"></a>                <span class="src-comm">// sheetProtection</span></li>
<li><a name="a91"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_Worksheet.html#method_writeSheetProtection">_writeSheetProtection</a><span class="src-sym">(</span><span class="src-var">$objWriter</span><span class="src-sym">, </span><span class="src-var">$pSheet</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a92"></a>      </li>
<li><a name="a93"></a>                <span class="src-comm">// protectedRanges</span></li>
<li><a name="a94"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_Worksheet.html#method_writeProtectedRanges">_writeProtectedRanges</a><span class="src-sym">(</span><span class="src-var">$objWriter</span><span class="src-sym">, </span><span class="src-var">$pSheet</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a95"></a>                </li>
<li><a name="a96"></a>                <span class="src-comm">// autoFilter</span></li>
<li><a name="a97"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_Worksheet.html#method_writeAutoFilter">_writeAutoFilter</a><span class="src-sym">(</span><span class="src-var">$objWriter</span><span class="src-sym">, </span><span class="src-var">$pSheet</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a98"></a>                </li>
<li><a name="a99"></a>                <span class="src-comm">// mergeCells</span></li>
<li><a name="a100"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_Worksheet.html#method_writeMergeCells">_writeMergeCells</a><span class="src-sym">(</span><span class="src-var">$objWriter</span><span class="src-sym">, </span><span class="src-var">$pSheet</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a101"></a>                </li>
<li><a name="a102"></a>                <span class="src-comm">// conditionalFormatting</span></li>
<li><a name="a103"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_Worksheet.html#method_writeConditionalFormatting">_writeConditionalFormatting</a><span class="src-sym">(</span><span class="src-var">$objWriter</span><span class="src-sym">, </span><span class="src-var">$pSheet</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a104"></a>                </li>
<li><a name="a105"></a>                <span class="src-comm">// Print options</span></li>
<li><a name="a106"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_Worksheet.html#method_writePrintOptions">_writePrintOptions</a><span class="src-sym">(</span><span class="src-var">$objWriter</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a107"></a>                                </li>
<li><a name="a108"></a>                <span class="src-comm">// Page margins</span></li>
<li><a name="a109"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_Worksheet.html#method_writePageMargins">_writePageMargins</a><span class="src-sym">(</span><span class="src-var">$objWriter</span><span class="src-sym">, </span><span class="src-var">$pSheet</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a110"></a>&nbsp;</li>
<li><a name="a111"></a>                <span class="src-comm">// Page setup</span></li>
<li><a name="a112"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_Worksheet.html#method_writePageSetup">_writePageSetup</a><span class="src-sym">(</span><span class="src-var">$objWriter</span><span class="src-sym">, </span><span class="src-var">$pSheet</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a113"></a>                </li>
<li><a name="a114"></a>                <span class="src-comm">// Header / footer</span></li>
<li><a name="a115"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_Worksheet.html#method_writeHeaderFooter">_writeHeaderFooter</a><span class="src-sym">(</span><span class="src-var">$objWriter</span><span class="src-sym">, </span><span class="src-var">$pSheet</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a116"></a>                </li>
<li><a name="a117"></a>                <span class="src-comm">// Breaks</span></li>
<li><a name="a118"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_Worksheet.html#method_writeBreaks">_writeBreaks</a><span class="src-sym">(</span><span class="src-var">$objWriter</span><span class="src-sym">, </span><span class="src-var">$pSheet</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a119"></a>                </li>
<li><a name="a120"></a>                <span class="src-comm">// Drawings</span></li>
<li><a name="a121"></a>                <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_Worksheet.html#method_writeDrawings">_writeDrawings</a><span class="src-sym">(</span><span class="src-var">$objWriter</span><span class="src-sym">, </span><span class="src-var">$pSheet</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a122"></a>                </li>
<li><a name="a123"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">endElement</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a124"></a>&nbsp;</li>
<li><a name="a125"></a>            <span class="src-comm">// Return</span></li>
<li><a name="a126"></a>            <span class="src-key">return </span><span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">outputMemory</span><span class="src-sym">(</span><span class="src-id">true</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a127"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a128"></a>            throw <span class="src-key">new </span><span class="src-id">Exception</span><span class="src-sym">(</span><span class="src-str">&quot;Invalid PHPExcel_Worksheet object passed.&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a129"></a>        <span class="src-sym">}</span></li>
<li><a name="a130"></a>    <span class="src-sym">}</span></li>
<li><a name="a131"></a>    </li>
<li><a name="a132"></a>    <span class="src-doc">/**</span></li>
<li><a name="a133"></a><span class="src-doc">     * Write SheetPr</span></li>
<li><a name="a134"></a><span class="src-doc">     *</span></li>
<li><a name="a135"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">    </span><span class="src-doc-type">xmlWriter </span><span class="src-doc">                </span><span class="src-doc-var">$objWriter </span><span class="src-doc">        XML Writer</span></li>
<li><a name="a136"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">    </span><span class="src-doc-type">PHPExcel_Worksheet </span><span class="src-doc">   </span><span class="src-doc-var">$pSheet </span><span class="src-doc">           Worksheet</span></li>
<li><a name="a137"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@throws</span><span class="src-doc">     Exception</span></li>
<li><a name="a138"></a><span class="src-doc">     */</span></li>
<li><a name="a139"></a>    <span class="src-key">private </span><span class="src-key">function </span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_Worksheet.html#method_writeSheetPr">_writeSheetPr</a><span class="src-sym">(</span><span class="src-var">$objWriter </span>= <span class="src-id">null</span><span class="src-sym">, </span><span class="src-var">$pSheet </span>= <span class="src-id">null</span><span class="src-sym">)</span></li>
<li><a name="a140"></a>    <span class="src-sym">{</span></li>
<li><a name="a141"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$objWriter </span>instanceof <span class="src-id">xmlWriter </span>&amp;&amp; <span class="src-var">$pSheet </span>instanceof <span class="src-id"><a href="../PHPExcel/PHPExcel_Worksheet.html">PHPExcel_Worksheet</a></span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a142"></a>            <span class="src-comm">// sheetPr</span></li>
<li><a name="a143"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">startElement</span><span class="src-sym">(</span><span class="src-str">'sheetPr'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a144"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'codeName'</span><span class="src-sym">, </span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getTitle</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a145"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">endElement</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a146"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a147"></a>            throw <span class="src-key">new </span><span class="src-id">Exception</span><span class="src-sym">(</span><span class="src-str">&quot;Invalid parameters passed.&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a148"></a>        <span class="src-sym">}</span></li>
<li><a name="a149"></a>    <span class="src-sym">}</span></li>
<li><a name="a150"></a>    </li>
<li><a name="a151"></a>    <span class="src-doc">/**</span></li>
<li><a name="a152"></a><span class="src-doc">     * Write Dimension</span></li>
<li><a name="a153"></a><span class="src-doc">     *</span></li>
<li><a name="a154"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">    </span><span class="src-doc-type">xmlWriter </span><span class="src-doc">                </span><span class="src-doc-var">$objWriter </span><span class="src-doc">        XML Writer</span></li>
<li><a name="a155"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">    </span><span class="src-doc-type">PHPExcel_Worksheet </span><span class="src-doc">   </span><span class="src-doc-var">$pSheet </span><span class="src-doc">           Worksheet</span></li>
<li><a name="a156"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@throws</span><span class="src-doc">     Exception</span></li>
<li><a name="a157"></a><span class="src-doc">     */</span></li>
<li><a name="a158"></a>    <span class="src-key">private </span><span class="src-key">function </span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_Worksheet.html#method_writeDimension">_writeDimension</a><span class="src-sym">(</span><span class="src-var">$objWriter </span>= <span class="src-id">null</span><span class="src-sym">, </span><span class="src-var">$pSheet </span>= <span class="src-id">null</span><span class="src-sym">)</span></li>
<li><a name="a159"></a>    <span class="src-sym">{</span></li>
<li><a name="a160"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$objWriter </span>instanceof <span class="src-id">xmlWriter </span>&amp;&amp; <span class="src-var">$pSheet </span>instanceof <span class="src-id"><a href="../PHPExcel/PHPExcel_Worksheet.html">PHPExcel_Worksheet</a></span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a161"></a>            <span class="src-comm">// dimension</span></li>
<li><a name="a162"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">startElement</span><span class="src-sym">(</span><span class="src-str">'dimension'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a163"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'ref'</span><span class="src-sym">, </span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">calculateWorksheetDimension</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a164"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">endElement</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a165"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a166"></a>            throw <span class="src-key">new </span><span class="src-id">Exception</span><span class="src-sym">(</span><span class="src-str">&quot;Invalid parameters passed.&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a167"></a>        <span class="src-sym">}</span></li>
<li><a name="a168"></a>    <span class="src-sym">}</span></li>
<li><a name="a169"></a>    </li>
<li><a name="a170"></a>    <span class="src-doc">/**</span></li>
<li><a name="a171"></a><span class="src-doc">     * Write SheetViews</span></li>
<li><a name="a172"></a><span class="src-doc">     *</span></li>
<li><a name="a173"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">    </span><span class="src-doc-type">xmlWriter </span><span class="src-doc-var">$objWriter </span><span class="src-doc">        XML Writer</span></li>
<li><a name="a174"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@throws</span><span class="src-doc">     Exception</span></li>
<li><a name="a175"></a><span class="src-doc">     */</span></li>
<li><a name="a176"></a>    <span class="src-key">private </span><span class="src-key">function </span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_Worksheet.html#method_writeSheetViews">_writeSheetViews</a><span class="src-sym">(</span><span class="src-var">$objWriter </span>= <span class="src-id">null</span><span class="src-sym">)</span></li>
<li><a name="a177"></a>    <span class="src-sym">{</span></li>
<li><a name="a178"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$objWriter </span>instanceof <span class="src-id">xmlWriter</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a179"></a>            <span class="src-comm">// sheetViews</span></li>
<li><a name="a180"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">startElement</span><span class="src-sym">(</span><span class="src-str">'sheetViews'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a181"></a>                </li>
<li><a name="a182"></a>                <span class="src-comm">// sheetView</span></li>
<li><a name="a183"></a>                <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">startElement</span><span class="src-sym">(</span><span class="src-str">'sheetView'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a184"></a>                <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'tabSelected'</span><span class="src-sym">,         </span><span class="src-str">'1'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a185"></a>                <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'workbookViewId'</span><span class="src-sym">,    </span><span class="src-str">'0'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a186"></a>                        </li>
<li><a name="a187"></a>                    <span class="src-comm">// Selection</span></li>
<li><a name="a188"></a>                    <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeElement</span><span class="src-sym">(</span><span class="src-str">'selection'</span><span class="src-sym">, </span><span class="src-id">null</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a189"></a>                        </li>
<li><a name="a190"></a>                <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">endElement</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a191"></a>                </li>
<li><a name="a192"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">endElement</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a193"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a194"></a>            throw <span class="src-key">new </span><span class="src-id">Exception</span><span class="src-sym">(</span><span class="src-str">&quot;Invalid parameters passed.&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a195"></a>        <span class="src-sym">}</span></li>
<li><a name="a196"></a>    <span class="src-sym">}</span></li>
<li><a name="a197"></a>    </li>
<li><a name="a198"></a>    <span class="src-doc">/**</span></li>
<li><a name="a199"></a><span class="src-doc">     * Write SheetFormatPr</span></li>
<li><a name="a200"></a><span class="src-doc">     *</span></li>
<li><a name="a201"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">    </span><span class="src-doc-type">xmlWriter </span><span class="src-doc-var">$objWriter </span><span class="src-doc">        XML Writer</span></li>
<li><a name="a202"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@throws</span><span class="src-doc">     Exception</span></li>
<li><a name="a203"></a><span class="src-doc">     */</span></li>
<li><a name="a204"></a>    <span class="src-key">private </span><span class="src-key">function </span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_Worksheet.html#method_writeSheetFormatPr">_writeSheetFormatPr</a><span class="src-sym">(</span><span class="src-var">$objWriter </span>= <span class="src-id">null</span><span class="src-sym">)</span></li>
<li><a name="a205"></a>    <span class="src-sym">{</span></li>
<li><a name="a206"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$objWriter </span>instanceof <span class="src-id">xmlWriter</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a207"></a>            <span class="src-comm">// sheetFormatPr</span></li>
<li><a name="a208"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">startElement</span><span class="src-sym">(</span><span class="src-str">'sheetFormatPr'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a209"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'defaultRowHeight'</span><span class="src-sym">, </span><span class="src-str">'12.75'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a210"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">endElement</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a211"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a212"></a>            throw <span class="src-key">new </span><span class="src-id">Exception</span><span class="src-sym">(</span><span class="src-str">&quot;Invalid parameters passed.&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a213"></a>        <span class="src-sym">}</span></li>
<li><a name="a214"></a>    <span class="src-sym">}</span></li>
<li><a name="a215"></a>    </li>
<li><a name="a216"></a>    <span class="src-doc">/**</span></li>
<li><a name="a217"></a><span class="src-doc">     * Write Cols</span></li>
<li><a name="a218"></a><span class="src-doc">     *</span></li>
<li><a name="a219"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">    </span><span class="src-doc-type">xmlWriter </span><span class="src-doc">            </span><span class="src-doc-var">$objWriter </span><span class="src-doc">        XML Writer</span></li>
<li><a name="a220"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">    </span><span class="src-doc-type">PHPExcel_Worksheet </span><span class="src-doc">   </span><span class="src-doc-var">$pSheet </span><span class="src-doc">           Worksheet</span></li>
<li><a name="a221"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@throws</span><span class="src-doc">     Exception</span></li>
<li><a name="a222"></a><span class="src-doc">     */</span></li>
<li><a name="a223"></a>    <span class="src-key">private </span><span class="src-key">function </span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_Worksheet.html#method_writeCols">_writeCols</a><span class="src-sym">(</span><span class="src-var">$objWriter </span>= <span class="src-id">null</span><span class="src-sym">, </span><span class="src-var">$pSheet </span>= <span class="src-id">null</span><span class="src-sym">)</span></li>
<li><a name="a224"></a>    <span class="src-sym">{</span></li>
<li><a name="a225"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$objWriter </span>instanceof <span class="src-id">xmlWriter </span>&amp;&amp; <span class="src-var">$pSheet </span>instanceof <span class="src-id"><a href="../PHPExcel/PHPExcel_Worksheet.html">PHPExcel_Worksheet</a></span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a226"></a>            <span class="src-comm">// cols</span></li>
<li><a name="a227"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">startElement</span><span class="src-sym">(</span><span class="src-str">'cols'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a228"></a>                    </li>
<li><a name="a229"></a>                <span class="src-comm">// Check if there is at least one column dimension specified. If not, create one.</span></li>
<li><a name="a230"></a>                <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getColumnDimensions</span><span class="src-sym">(</span><span class="src-sym">)) </span>== <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a231"></a>                    <span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getColumnDimension</span><span class="src-sym">(</span><span class="src-str">'A'</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">setWidth</span><span class="src-sym">(</span><span class="src-num">10</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a232"></a>                <span class="src-sym">}</span></li>
<li><a name="a233"></a>                    </li>
<li><a name="a234"></a>                <span class="src-comm">// Loop trough column dimensions</span></li>
<li><a name="a235"></a>                <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getColumnDimensions</span><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-key">as </span><span class="src-var">$colDimension</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a236"></a>                    <span class="src-comm">// col</span></li>
<li><a name="a237"></a>                    <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">startElement</span><span class="src-sym">(</span><span class="src-str">'col'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a238"></a>                    <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'min'</span><span class="src-sym">,     </span><span class="src-id"><a href="../PHPExcel/PHPExcel_Cell.html">PHPExcel_Cell</a></span><span class="src-sym">::</span><a href="../PHPExcel/PHPExcel_Cell.html#methodcolumnIndexFromString">columnIndexFromString</a><span class="src-sym">(</span><span class="src-var">$colDimension</span><span class="src-sym">-&gt;</span><span class="src-id">getColumnIndex</span><span class="src-sym">(</span><span class="src-sym">)))</span><span class="src-sym">;</span></li>
<li><a name="a239"></a>                    <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'max'</span><span class="src-sym">,     </span><span class="src-id"><a href="../PHPExcel/PHPExcel_Cell.html">PHPExcel_Cell</a></span><span class="src-sym">::</span><a href="../PHPExcel/PHPExcel_Cell.html#methodcolumnIndexFromString">columnIndexFromString</a><span class="src-sym">(</span><span class="src-var">$colDimension</span><span class="src-sym">-&gt;</span><span class="src-id">getColumnIndex</span><span class="src-sym">(</span><span class="src-sym">)))</span><span class="src-sym">;</span></li>
<li><a name="a240"></a>                        </li>
<li><a name="a241"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$colDimension</span><span class="src-sym">-&gt;</span><span class="src-id">getWidth</span><span class="src-sym">(</span><span class="src-sym">) </span>&lt; <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a242"></a>                        <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'bestFit'</span><span class="src-sym">,         </span><span class="src-str">'1'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a243"></a>                        <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'width'</span><span class="src-sym">,         </span><span class="src-str">'10'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a244"></a>                    <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a245"></a>                        <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'width'</span><span class="src-sym">,         </span><span class="src-var">$colDimension</span><span class="src-sym">-&gt;</span><span class="src-id">getWidth</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a246"></a>                        <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'customWidth'</span><span class="src-sym">,    </span><span class="src-str">'1'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a247"></a>                    <span class="src-sym">}</span></li>
<li><a name="a248"></a>                    <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">endElement</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a249"></a>                <span class="src-sym">}</span></li>
<li><a name="a250"></a>                </li>
<li><a name="a251"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">endElement</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a252"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a253"></a>            throw <span class="src-key">new </span><span class="src-id">Exception</span><span class="src-sym">(</span><span class="src-str">&quot;Invalid parameters passed.&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a254"></a>        <span class="src-sym">}</span></li>
<li><a name="a255"></a>    <span class="src-sym">}</span></li>
<li><a name="a256"></a>&nbsp;</li>
<li><a name="a257"></a>    <span class="src-doc">/**</span></li>
<li><a name="a258"></a><span class="src-doc">     * Write SheetProtection</span></li>
<li><a name="a259"></a><span class="src-doc">     *</span></li>
<li><a name="a260"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">    </span><span class="src-doc-type">xmlWriter </span><span class="src-doc">            </span><span class="src-doc-var">$objWriter </span><span class="src-doc">        XML Writer</span></li>
<li><a name="a261"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">    </span><span class="src-doc-type">PHPExcel_Worksheet </span><span class="src-doc">   </span><span class="src-doc-var">$pSheet </span><span class="src-doc">           Worksheet</span></li>
<li><a name="a262"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@throws</span><span class="src-doc">     Exception</span></li>
<li><a name="a263"></a><span class="src-doc">     */</span></li>
<li><a name="a264"></a>    <span class="src-key">private </span><span class="src-key">function </span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_Worksheet.html#method_writeSheetProtection">_writeSheetProtection</a><span class="src-sym">(</span><span class="src-var">$objWriter </span>= <span class="src-id">null</span><span class="src-sym">, </span><span class="src-var">$pSheet </span>= <span class="src-id">null</span><span class="src-sym">)</span></li>
<li><a name="a265"></a>    <span class="src-sym">{</span></li>
<li><a name="a266"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$objWriter </span>instanceof <span class="src-id">xmlWriter </span>&amp;&amp; <span class="src-var">$pSheet </span>instanceof <span class="src-id"><a href="../PHPExcel/PHPExcel_Worksheet.html">PHPExcel_Worksheet</a></span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a267"></a>            <span class="src-comm">// sheetProtection</span></li>
<li><a name="a268"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">startElement</span><span class="src-sym">(</span><span class="src-str">'sheetProtection'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a269"></a>            </li>
<li><a name="a270"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getProtection</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getPassword</span><span class="src-sym">(</span><span class="src-sym">) </span>!= <span class="src-str">''</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a271"></a>                <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'password'</span><span class="src-sym">,                 </span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getProtection</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getPassword</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a272"></a>            <span class="src-sym">}</span></li>
<li><a name="a273"></a>            </li>
<li><a name="a274"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'sheet'</span><span class="src-sym">,                 </span><span class="src-sym">(</span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getProtection</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getSheet</span><span class="src-sym">(</span><span class="src-sym">)                 </span>? <span class="src-str">'true' </span>: <span class="src-str">'false'</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a275"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'objects'</span><span class="src-sym">,                 </span><span class="src-sym">(</span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getProtection</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getObjects</span><span class="src-sym">(</span><span class="src-sym">)             </span>? <span class="src-str">'true' </span>: <span class="src-str">'false'</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a276"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'scenarios'</span><span class="src-sym">,             </span><span class="src-sym">(</span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getProtection</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getScenarios</span><span class="src-sym">(</span><span class="src-sym">)             </span>? <span class="src-str">'true' </span>: <span class="src-str">'false'</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a277"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'formatCells'</span><span class="src-sym">,             </span><span class="src-sym">(</span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getProtection</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getFormatCells</span><span class="src-sym">(</span><span class="src-sym">)         </span>? <span class="src-str">'true' </span>: <span class="src-str">'false'</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a278"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'formatColumns'</span><span class="src-sym">,         </span><span class="src-sym">(</span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getProtection</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getFormatColumns</span><span class="src-sym">(</span><span class="src-sym">)         </span>? <span class="src-str">'true' </span>: <span class="src-str">'false'</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a279"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'formatRows'</span><span class="src-sym">,             </span><span class="src-sym">(</span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getProtection</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getFormatRows</span><span class="src-sym">(</span><span class="src-sym">)             </span>? <span class="src-str">'true' </span>: <span class="src-str">'false'</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a280"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'insertColumns'</span><span class="src-sym">,         </span><span class="src-sym">(</span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getProtection</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getInsertColumns</span><span class="src-sym">(</span><span class="src-sym">)         </span>? <span class="src-str">'true' </span>: <span class="src-str">'false'</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a281"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'insertRows'</span><span class="src-sym">,             </span><span class="src-sym">(</span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getProtection</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getInsertRows</span><span class="src-sym">(</span><span class="src-sym">)             </span>? <span class="src-str">'true' </span>: <span class="src-str">'false'</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a282"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'insertHyperlinks'</span><span class="src-sym">,         </span><span class="src-sym">(</span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getProtection</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getInsertHyperlinks</span><span class="src-sym">(</span><span class="src-sym">)     </span>? <span class="src-str">'true' </span>: <span class="src-str">'false'</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a283"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'deleteColumns'</span><span class="src-sym">,         </span><span class="src-sym">(</span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getProtection</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getDeleteColumns</span><span class="src-sym">(</span><span class="src-sym">)         </span>? <span class="src-str">'true' </span>: <span class="src-str">'false'</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a284"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'deleteRows'</span><span class="src-sym">,             </span><span class="src-sym">(</span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getProtection</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getDeleteRows</span><span class="src-sym">(</span><span class="src-sym">)             </span>? <span class="src-str">'true' </span>: <span class="src-str">'false'</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a285"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'selectLockedCells'</span><span class="src-sym">,     </span><span class="src-sym">(</span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getProtection</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getSelectLockedCells</span><span class="src-sym">(</span><span class="src-sym">)     </span>? <span class="src-str">'true' </span>: <span class="src-str">'false'</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a286"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'sort'</span><span class="src-sym">,                     </span><span class="src-sym">(</span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getProtection</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getSort</span><span class="src-sym">(</span><span class="src-sym">)                 </span>? <span class="src-str">'true' </span>: <span class="src-str">'false'</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a287"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'autoFilter'</span><span class="src-sym">,             </span><span class="src-sym">(</span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getProtection</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getAutoFilter</span><span class="src-sym">(</span><span class="src-sym">)             </span>? <span class="src-str">'true' </span>: <span class="src-str">'false'</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a288"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'pivotTables'</span><span class="src-sym">,             </span><span class="src-sym">(</span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getProtection</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getPivotTables</span><span class="src-sym">(</span><span class="src-sym">)         </span>? <span class="src-str">'true' </span>: <span class="src-str">'false'</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a289"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'selectUnlockedCells'</span><span class="src-sym">,     </span><span class="src-sym">(</span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getProtection</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getSelectUnlockedCells</span><span class="src-sym">(</span><span class="src-sym">)    </span>? <span class="src-str">'true' </span>: <span class="src-str">'false'</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a290"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">endElement</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a291"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a292"></a>            throw <span class="src-key">new </span><span class="src-id">Exception</span><span class="src-sym">(</span><span class="src-str">&quot;Invalid parameters passed.&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a293"></a>        <span class="src-sym">}</span></li>
<li><a name="a294"></a>    <span class="src-sym">}</span></li>
<li><a name="a295"></a>&nbsp;</li>
<li><a name="a296"></a>    <span class="src-doc">/**</span></li>
<li><a name="a297"></a><span class="src-doc">     * Write ConditionalFormatting</span></li>
<li><a name="a298"></a><span class="src-doc">     *</span></li>
<li><a name="a299"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">    </span><span class="src-doc-type">xmlWriter </span><span class="src-doc">            </span><span class="src-doc-var">$objWriter </span><span class="src-doc">        XML Writer</span></li>
<li><a name="a300"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">    </span><span class="src-doc-type">PHPExcel_Worksheet </span><span class="src-doc">   </span><span class="src-doc-var">$pSheet </span><span class="src-doc">           Worksheet</span></li>
<li><a name="a301"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@throws</span><span class="src-doc">     Exception</span></li>
<li><a name="a302"></a><span class="src-doc">     */</span></li>
<li><a name="a303"></a>    <span class="src-key">private </span><span class="src-key">function </span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_Worksheet.html#method_writeConditionalFormatting">_writeConditionalFormatting</a><span class="src-sym">(</span><span class="src-var">$objWriter </span>= <span class="src-id">null</span><span class="src-sym">, </span><span class="src-var">$pSheet </span>= <span class="src-id">null</span><span class="src-sym">)</span></li>
<li><a name="a304"></a>    <span class="src-sym">{</span></li>
<li><a name="a305"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$objWriter </span>instanceof <span class="src-id">xmlWriter </span>&amp;&amp; <span class="src-var">$pSheet </span>instanceof <span class="src-id"><a href="../PHPExcel/PHPExcel_Worksheet.html">PHPExcel_Worksheet</a></span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a306"></a>            <span class="src-comm">// Conditional id</span></li>
<li><a name="a307"></a>            <span class="src-var">$id </span>= <span class="src-num">1</span><span class="src-sym">;</span></li>
<li><a name="a308"></a>            </li>
<li><a name="a309"></a>            <span class="src-comm">// Loop trough styles in the current worksheet</span></li>
<li><a name="a310"></a>            <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getStyles</span><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-key">as </span><span class="src-var">$cellCoodrinate </span>=&gt; <span class="src-var">$style</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a311"></a>                <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$style</span><span class="src-sym">-&gt;</span><span class="src-id">getConditionalStyles</span><span class="src-sym">(</span><span class="src-sym">)) </span>&gt; <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a312"></a>                    <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$style</span><span class="src-sym">-&gt;</span><span class="src-id">getConditionalStyles</span><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-key">as </span><span class="src-var">$conditional</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a313"></a>                        </li>
<li><a name="a314"></a>                        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$conditional</span><span class="src-sym">-&gt;</span><span class="src-id">getConditionType</span><span class="src-sym">(</span><span class="src-sym">) </span>!= <span class="src-id"><a href="../PHPExcel_Style/PHPExcel_Style_Conditional.html">PHPExcel_Style_Conditional</a></span><span class="src-sym">::</span><span class="src-id">CONDITION_NONE</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a315"></a>                            <span class="src-comm">// conditionalFormatting</span></li>
<li><a name="a316"></a>                            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">startElement</span><span class="src-sym">(</span><span class="src-str">'conditionalFormatting'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a317"></a>                            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'sqref'</span><span class="src-sym">,     </span><span class="src-var">$cellCoodrinate</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a318"></a>                            </li>
<li><a name="a319"></a>                                <span class="src-comm">// cfRule</span></li>
<li><a name="a320"></a>                                <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">startElement</span><span class="src-sym">(</span><span class="src-str">'cfRule'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a321"></a>                                <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'type'</span><span class="src-sym">,         </span><span class="src-var">$conditional</span><span class="src-sym">-&gt;</span><span class="src-id">getConditionType</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a322"></a>                                <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'dxfId'</span><span class="src-sym">,     </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_WriterPart.html#methodgetParentWriter">getParentWriter</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getStylesConditionalHashTable</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getIndexForHashCode</span><span class="src-sym">( </span><span class="src-var">$conditional</span><span class="src-sym">-&gt;</span><span class="src-id">getHashCode</span><span class="src-sym">(</span><span class="src-sym">) ))</span><span class="src-sym">;</span></li>
<li><a name="a323"></a>                                <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'priority'</span><span class="src-sym">,     </span><span class="src-var">$id</span>++<span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a324"></a>                                </li>
<li><a name="a325"></a>                                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$conditional</span><span class="src-sym">-&gt;</span><span class="src-id">getConditionType</span><span class="src-sym">(</span><span class="src-sym">) </span>== <span class="src-id"><a href="../PHPExcel_Style/PHPExcel_Style_Conditional.html">PHPExcel_Style_Conditional</a></span><span class="src-sym">::</span><span class="src-id">CONDITION_CELLIS</span></li>
<li><a name="a326"></a>                                    &amp;&amp; <span class="src-var">$conditional</span><span class="src-sym">-&gt;</span><span class="src-id">getOperatorType</span><span class="src-sym">(</span><span class="src-sym">) </span>!= <span class="src-id"><a href="../PHPExcel_Style/PHPExcel_Style_Conditional.html">PHPExcel_Style_Conditional</a></span><span class="src-sym">::</span><span class="src-id">OPERATOR_NONE</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a327"></a>                                    <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'operator'</span><span class="src-sym">,     </span><span class="src-var">$conditional</span><span class="src-sym">-&gt;</span><span class="src-id">getOperatorType</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a328"></a>                                    </li>
<li><a name="a329"></a>                                    <span class="src-comm">// Formula</span></li>
<li><a name="a330"></a>                                    <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeElement</span><span class="src-sym">(</span><span class="src-str">'formula'</span><span class="src-sym">,    </span><span class="src-var">$conditional</span><span class="src-sym">-&gt;</span><span class="src-id">getCondition</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;        </span></li>
<li><a name="a331"></a>                                <span class="src-sym">}        </span></li>
<li><a name="a332"></a>                                </li>
<li><a name="a333"></a>                                <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">endElement</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a334"></a>                            </li>
<li><a name="a335"></a>                            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">endElement</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a336"></a>                        <span class="src-sym">}</span></li>
<li><a name="a337"></a>&nbsp;</li>
<li><a name="a338"></a>                    <span class="src-sym">}</span></li>
<li><a name="a339"></a>                <span class="src-sym">}</span></li>
<li><a name="a340"></a>            <span class="src-sym">}</span></li>
<li><a name="a341"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a342"></a>            throw <span class="src-key">new </span><span class="src-id">Exception</span><span class="src-sym">(</span><span class="src-str">&quot;Invalid parameters passed.&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a343"></a>        <span class="src-sym">}</span></li>
<li><a name="a344"></a>    <span class="src-sym">}</span></li>
<li><a name="a345"></a>&nbsp;</li>
<li><a name="a346"></a>    <span class="src-doc">/**</span></li>
<li><a name="a347"></a><span class="src-doc">     * Write ProtectedRanges</span></li>
<li><a name="a348"></a><span class="src-doc">     *</span></li>
<li><a name="a349"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">    </span><span class="src-doc-type">xmlWriter </span><span class="src-doc">            </span><span class="src-doc-var">$objWriter </span><span class="src-doc">        XML Writer</span></li>
<li><a name="a350"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">    </span><span class="src-doc-type">PHPExcel_Worksheet </span><span class="src-doc">   </span><span class="src-doc-var">$pSheet </span><span class="src-doc">           Worksheet</span></li>
<li><a name="a351"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@throws</span><span class="src-doc">     Exception</span></li>
<li><a name="a352"></a><span class="src-doc">     */</span></li>
<li><a name="a353"></a>    <span class="src-key">private </span><span class="src-key">function </span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_Worksheet.html#method_writeProtectedRanges">_writeProtectedRanges</a><span class="src-sym">(</span><span class="src-var">$objWriter </span>= <span class="src-id">null</span><span class="src-sym">, </span><span class="src-var">$pSheet </span>= <span class="src-id">null</span><span class="src-sym">)</span></li>
<li><a name="a354"></a>    <span class="src-sym">{</span></li>
<li><a name="a355"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$objWriter </span>instanceof <span class="src-id">xmlWriter </span>&amp;&amp; <span class="src-var">$pSheet </span>instanceof <span class="src-id"><a href="../PHPExcel/PHPExcel_Worksheet.html">PHPExcel_Worksheet</a></span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a356"></a>            <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getProtectedCells</span><span class="src-sym">(</span><span class="src-sym">)) </span>&gt; <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a357"></a>                <span class="src-comm">// protectedRanges</span></li>
<li><a name="a358"></a>                <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">startElement</span><span class="src-sym">(</span><span class="src-str">'protectedRanges'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a359"></a>                </li>
<li><a name="a360"></a>                    <span class="src-comm">// Loop protectedRanges</span></li>
<li><a name="a361"></a>                    <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getProtectedCells</span><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-key">as </span><span class="src-var">$protectedCell </span>=&gt; <span class="src-var">$passwordHash</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a362"></a>                        <span class="src-comm">// protectedRange</span></li>
<li><a name="a363"></a>                        <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">startElement</span><span class="src-sym">(</span><span class="src-str">'protectedRange'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a364"></a>                        <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'name'</span><span class="src-sym">,         </span><a href="http://www.php.net/md5">md5</a><span class="src-sym">(</span><span class="src-var">$protectedCell</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a365"></a>                        <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'sqref'</span><span class="src-sym">,     </span><span class="src-var">$protectedCell</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a366"></a>                        <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'password'</span><span class="src-sym">,     </span><span class="src-var">$passwordHash</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a367"></a>                        <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">endElement</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a368"></a>                    <span class="src-sym">}</span></li>
<li><a name="a369"></a>                </li>
<li><a name="a370"></a>                <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">endElement</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a371"></a>            <span class="src-sym">}</span></li>
<li><a name="a372"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a373"></a>            throw <span class="src-key">new </span><span class="src-id">Exception</span><span class="src-sym">(</span><span class="src-str">&quot;Invalid parameters passed.&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a374"></a>        <span class="src-sym">}</span></li>
<li><a name="a375"></a>    <span class="src-sym">}</span></li>
<li><a name="a376"></a>    </li>
<li><a name="a377"></a>    <span class="src-doc">/**</span></li>
<li><a name="a378"></a><span class="src-doc">     * Write MergeCells</span></li>
<li><a name="a379"></a><span class="src-doc">     *</span></li>
<li><a name="a380"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">    </span><span class="src-doc-type">xmlWriter </span><span class="src-doc">            </span><span class="src-doc-var">$objWriter </span><span class="src-doc">        XML Writer</span></li>
<li><a name="a381"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">    </span><span class="src-doc-type">PHPExcel_Worksheet </span><span class="src-doc">   </span><span class="src-doc-var">$pSheet </span><span class="src-doc">           Worksheet</span></li>
<li><a name="a382"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@throws</span><span class="src-doc">     Exception</span></li>
<li><a name="a383"></a><span class="src-doc">     */</span></li>
<li><a name="a384"></a>    <span class="src-key">private </span><span class="src-key">function </span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_Worksheet.html#method_writeMergeCells">_writeMergeCells</a><span class="src-sym">(</span><span class="src-var">$objWriter </span>= <span class="src-id">null</span><span class="src-sym">, </span><span class="src-var">$pSheet </span>= <span class="src-id">null</span><span class="src-sym">)</span></li>
<li><a name="a385"></a>    <span class="src-sym">{</span></li>
<li><a name="a386"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$objWriter </span>instanceof <span class="src-id">xmlWriter </span>&amp;&amp; <span class="src-var">$pSheet </span>instanceof <span class="src-id"><a href="../PHPExcel/PHPExcel_Worksheet.html">PHPExcel_Worksheet</a></span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a387"></a>            <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getMergeCells</span><span class="src-sym">(</span><span class="src-sym">)) </span>&gt; <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a388"></a>                <span class="src-comm">// mergeCells</span></li>
<li><a name="a389"></a>                <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">startElement</span><span class="src-sym">(</span><span class="src-str">'mergeCells'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a390"></a>                </li>
<li><a name="a391"></a>                    <span class="src-comm">// Loop mergeCells</span></li>
<li><a name="a392"></a>                    <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getMergeCells</span><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-key">as </span><span class="src-var">$mergeCell</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a393"></a>                        <span class="src-comm">// mergeCell</span></li>
<li><a name="a394"></a>                        <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">startElement</span><span class="src-sym">(</span><span class="src-str">'mergeCell'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a395"></a>                        <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'ref'</span><span class="src-sym">, </span><span class="src-var">$mergeCell</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a396"></a>                        <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">endElement</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a397"></a>                    <span class="src-sym">}</span></li>
<li><a name="a398"></a>                </li>
<li><a name="a399"></a>                <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">endElement</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a400"></a>            <span class="src-sym">}</span></li>
<li><a name="a401"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a402"></a>            throw <span class="src-key">new </span><span class="src-id">Exception</span><span class="src-sym">(</span><span class="src-str">&quot;Invalid parameters passed.&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a403"></a>        <span class="src-sym">}</span></li>
<li><a name="a404"></a>    <span class="src-sym">}</span></li>
<li><a name="a405"></a>    </li>
<li><a name="a406"></a>    <span class="src-doc">/**</span></li>
<li><a name="a407"></a><span class="src-doc">     * Write PrintOptions</span></li>
<li><a name="a408"></a><span class="src-doc">     *</span></li>
<li><a name="a409"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">    </span><span class="src-doc-type">xmlWriter </span><span class="src-doc-var">$objWriter </span><span class="src-doc">        XML Writer</span></li>
<li><a name="a410"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@throws</span><span class="src-doc">     Exception</span></li>
<li><a name="a411"></a><span class="src-doc">     */</span></li>
<li><a name="a412"></a>    <span class="src-key">private </span><span class="src-key">function </span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_Worksheet.html#method_writePrintOptions">_writePrintOptions</a><span class="src-sym">(</span><span class="src-var">$objWriter </span>= <span class="src-id">null</span><span class="src-sym">)</span></li>
<li><a name="a413"></a>    <span class="src-sym">{</span></li>
<li><a name="a414"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$objWriter </span>instanceof <span class="src-id">xmlWriter</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a415"></a>            <span class="src-comm">// printOptions</span></li>
<li><a name="a416"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeElement</span><span class="src-sym">(</span><span class="src-str">'printOptions'</span><span class="src-sym">, </span><span class="src-id">null</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a417"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a418"></a>            throw <span class="src-key">new </span><span class="src-id">Exception</span><span class="src-sym">(</span><span class="src-str">&quot;Invalid parameters passed.&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a419"></a>        <span class="src-sym">}</span></li>
<li><a name="a420"></a>    <span class="src-sym">}</span></li>
<li><a name="a421"></a>    </li>
<li><a name="a422"></a>    <span class="src-doc">/**</span></li>
<li><a name="a423"></a><span class="src-doc">     * Write PageMargins</span></li>
<li><a name="a424"></a><span class="src-doc">     *</span></li>
<li><a name="a425"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">    </span><span class="src-doc-type">xmlWriter </span><span class="src-doc">                </span><span class="src-doc-var">$objWriter </span><span class="src-doc">        XML Writer</span></li>
<li><a name="a426"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">    </span><span class="src-doc-type">PHPExcel_Worksheet </span><span class="src-doc">   </span><span class="src-doc-var">$pSheet </span><span class="src-doc">           Worksheet</span></li>
<li><a name="a427"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@throws</span><span class="src-doc">     Exception</span></li>
<li><a name="a428"></a><span class="src-doc">     */</span></li>
<li><a name="a429"></a>    <span class="src-key">private </span><span class="src-key">function </span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_Worksheet.html#method_writePageMargins">_writePageMargins</a><span class="src-sym">(</span><span class="src-var">$objWriter </span>= <span class="src-id">null</span><span class="src-sym">, </span><span class="src-var">$pSheet </span>= <span class="src-id">null</span><span class="src-sym">)</span></li>
<li><a name="a430"></a>    <span class="src-sym">{</span></li>
<li><a name="a431"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$objWriter </span>instanceof <span class="src-id">xmlWriter </span>&amp;&amp; <span class="src-var">$pSheet </span>instanceof <span class="src-id"><a href="../PHPExcel/PHPExcel_Worksheet.html">PHPExcel_Worksheet</a></span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a432"></a>            <span class="src-comm">// pageMargins</span></li>
<li><a name="a433"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">startElement</span><span class="src-sym">(</span><span class="src-str">'pageMargins'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a434"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'left'</span><span class="src-sym">,         </span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getPageMargins</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getLeft</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a435"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'right'</span><span class="src-sym">,     </span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getPageMargins</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getRight</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a436"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'top'</span><span class="src-sym">,         </span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getPageMargins</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getTop</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a437"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'bottom'</span><span class="src-sym">,     </span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getPageMargins</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getBottom</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a438"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'header'</span><span class="src-sym">,     </span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getPageMargins</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getHeader</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a439"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'footer'</span><span class="src-sym">,     </span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getPageMargins</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getFooter</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a440"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">endElement</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;    </span></li>
<li><a name="a441"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a442"></a>            throw <span class="src-key">new </span><span class="src-id">Exception</span><span class="src-sym">(</span><span class="src-str">&quot;Invalid parameters passed.&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a443"></a>        <span class="src-sym">}</span></li>
<li><a name="a444"></a>    <span class="src-sym">}</span></li>
<li><a name="a445"></a>    </li>
<li><a name="a446"></a>    <span class="src-doc">/**</span></li>
<li><a name="a447"></a><span class="src-doc">     * Write AutoFilter</span></li>
<li><a name="a448"></a><span class="src-doc">     *</span></li>
<li><a name="a449"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">    </span><span class="src-doc-type">xmlWriter </span><span class="src-doc">                </span><span class="src-doc-var">$objWriter </span><span class="src-doc">        XML Writer</span></li>
<li><a name="a450"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">    </span><span class="src-doc-type">PHPExcel_Worksheet </span><span class="src-doc">       </span><span class="src-doc-var">$pSheet </span><span class="src-doc">           Worksheet</span></li>
<li><a name="a451"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@throws</span><span class="src-doc">     Exception</span></li>
<li><a name="a452"></a><span class="src-doc">     */</span></li>
<li><a name="a453"></a>    <span class="src-key">private </span><span class="src-key">function </span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_Worksheet.html#method_writeAutoFilter">_writeAutoFilter</a><span class="src-sym">(</span><span class="src-var">$objWriter </span>= <span class="src-id">null</span><span class="src-sym">, </span><span class="src-var">$pSheet </span>= <span class="src-id">null</span><span class="src-sym">)</span></li>
<li><a name="a454"></a>    <span class="src-sym">{</span></li>
<li><a name="a455"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$objWriter </span>instanceof <span class="src-id">xmlWriter </span>&amp;&amp; <span class="src-var">$pSheet </span>instanceof <span class="src-id"><a href="../PHPExcel/PHPExcel_Worksheet.html">PHPExcel_Worksheet</a></span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a456"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getAutoFilter</span><span class="src-sym">(</span><span class="src-sym">) </span>!= <span class="src-str">''</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a457"></a>                <span class="src-comm">// autoFilter</span></li>
<li><a name="a458"></a>                <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">startElement</span><span class="src-sym">(</span><span class="src-str">'autoFilter'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a459"></a>                <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'ref'</span><span class="src-sym">,         </span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getAutoFilter</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;                    </span></li>
<li><a name="a460"></a>                <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">endElement</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;    </span></li>
<li><a name="a461"></a>            <span class="src-sym">}</span></li>
<li><a name="a462"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a463"></a>            throw <span class="src-key">new </span><span class="src-id">Exception</span><span class="src-sym">(</span><span class="src-str">&quot;Invalid parameters passed.&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a464"></a>        <span class="src-sym">}</span></li>
<li><a name="a465"></a>    <span class="src-sym">}                </span></li>
<li><a name="a466"></a>                </li>
<li><a name="a467"></a>    <span class="src-doc">/**</span></li>
<li><a name="a468"></a><span class="src-doc">     * Write PageSetup</span></li>
<li><a name="a469"></a><span class="src-doc">     *</span></li>
<li><a name="a470"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">    </span><span class="src-doc-type">xmlWriter </span><span class="src-doc">                </span><span class="src-doc-var">$objWriter </span><span class="src-doc">        XML Writer</span></li>
<li><a name="a471"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">    </span><span class="src-doc-type">PHPExcel_Worksheet </span><span class="src-doc">   </span><span class="src-doc-var">$pSheet </span><span class="src-doc">           Worksheet</span></li>
<li><a name="a472"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@throws</span><span class="src-doc">     Exception</span></li>
<li><a name="a473"></a><span class="src-doc">     */</span></li>
<li><a name="a474"></a>    <span class="src-key">private </span><span class="src-key">function </span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_Worksheet.html#method_writePageSetup">_writePageSetup</a><span class="src-sym">(</span><span class="src-var">$objWriter </span>= <span class="src-id">null</span><span class="src-sym">, </span><span class="src-var">$pSheet </span>= <span class="src-id">null</span><span class="src-sym">)</span></li>
<li><a name="a475"></a>    <span class="src-sym">{</span></li>
<li><a name="a476"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$objWriter </span>instanceof <span class="src-id">xmlWriter </span>&amp;&amp; <span class="src-var">$pSheet </span>instanceof <span class="src-id"><a href="../PHPExcel/PHPExcel_Worksheet.html">PHPExcel_Worksheet</a></span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a477"></a>            <span class="src-comm">// pageSetup</span></li>
<li><a name="a478"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">startElement</span><span class="src-sym">(</span><span class="src-str">'pageSetup'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a479"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'paperSize'</span><span class="src-sym">,        </span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getPageSetup</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getPaperSize</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a480"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'orientation'</span><span class="src-sym">,     </span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getPageSetup</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getOrientation</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a481"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">endElement</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a482"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a483"></a>            throw <span class="src-key">new </span><span class="src-id">Exception</span><span class="src-sym">(</span><span class="src-str">&quot;Invalid parameters passed.&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a484"></a>        <span class="src-sym">}</span></li>
<li><a name="a485"></a>    <span class="src-sym">}</span></li>
<li><a name="a486"></a>    </li>
<li><a name="a487"></a>    <span class="src-doc">/**</span></li>
<li><a name="a488"></a><span class="src-doc">     * Write Header / Footer</span></li>
<li><a name="a489"></a><span class="src-doc">     *</span></li>
<li><a name="a490"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">    </span><span class="src-doc-type">xmlWriter </span><span class="src-doc">                </span><span class="src-doc-var">$objWriter </span><span class="src-doc">        XML Writer</span></li>
<li><a name="a491"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">    </span><span class="src-doc-type">PHPExcel_Worksheet </span><span class="src-doc">   </span><span class="src-doc-var">$pSheet </span><span class="src-doc">           Worksheet</span></li>
<li><a name="a492"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@throws</span><span class="src-doc">     Exception</span></li>
<li><a name="a493"></a><span class="src-doc">     */</span></li>
<li><a name="a494"></a>    <span class="src-key">private </span><span class="src-key">function </span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_Worksheet.html#method_writeHeaderFooter">_writeHeaderFooter</a><span class="src-sym">(</span><span class="src-var">$objWriter </span>= <span class="src-id">null</span><span class="src-sym">, </span><span class="src-var">$pSheet </span>= <span class="src-id">null</span><span class="src-sym">)</span></li>
<li><a name="a495"></a>    <span class="src-sym">{</span></li>
<li><a name="a496"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$objWriter </span>instanceof <span class="src-id">xmlWriter </span>&amp;&amp; <span class="src-var">$pSheet </span>instanceof <span class="src-id"><a href="../PHPExcel/PHPExcel_Worksheet.html">PHPExcel_Worksheet</a></span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a497"></a>            <span class="src-comm">// headerFooter</span></li>
<li><a name="a498"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">startElement</span><span class="src-sym">(</span><span class="src-str">'headerFooter'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a499"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'differentOddEven'</span><span class="src-sym">,     </span><span class="src-sym">(</span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getHeaderFooter</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getDifferentOddEven</span><span class="src-sym">(</span><span class="src-sym">) </span>? <span class="src-str">'true' </span>: <span class="src-str">'false'</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a500"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'differentFirst'</span><span class="src-sym">,     </span><span class="src-sym">(</span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getHeaderFooter</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getDifferentFirst</span><span class="src-sym">(</span><span class="src-sym">) </span>? <span class="src-str">'true' </span>: <span class="src-str">'false'</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a501"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'scaleWithDoc'</span><span class="src-sym">,         </span><span class="src-sym">(</span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getHeaderFooter</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getScaleWithDocument</span><span class="src-sym">(</span><span class="src-sym">) </span>? <span class="src-str">'true' </span>: <span class="src-str">'false'</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a502"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'alignWithMargins'</span><span class="src-sym">,     </span><span class="src-sym">(</span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getHeaderFooter</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getAlignWithMargins</span><span class="src-sym">(</span><span class="src-sym">) </span>? <span class="src-str">'true' </span>: <span class="src-str">'false'</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a503"></a>                </li>
<li><a name="a504"></a>                <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeElement</span><span class="src-sym">(</span><span class="src-str">'oddHeader'</span><span class="src-sym">,         </span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getHeaderFooter</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getOddHeader</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a505"></a>                <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeElement</span><span class="src-sym">(</span><span class="src-str">'oddFooter'</span><span class="src-sym">,         </span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getHeaderFooter</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getOddFooter</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a506"></a>                <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeElement</span><span class="src-sym">(</span><span class="src-str">'evenHeader'</span><span class="src-sym">,         </span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getHeaderFooter</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getEvenHeader</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a507"></a>                <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeElement</span><span class="src-sym">(</span><span class="src-str">'evenFooter'</span><span class="src-sym">,         </span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getHeaderFooter</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getEvenFooter</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a508"></a>                <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeElement</span><span class="src-sym">(</span><span class="src-str">'firstHeader'</span><span class="src-sym">,     </span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getHeaderFooter</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getFirstHeader</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a509"></a>                <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeElement</span><span class="src-sym">(</span><span class="src-str">'firstFooter'</span><span class="src-sym">,     </span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getHeaderFooter</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getFirstFooter</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a510"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">endElement</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a511"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a512"></a>            throw <span class="src-key">new </span><span class="src-id">Exception</span><span class="src-sym">(</span><span class="src-str">&quot;Invalid parameters passed.&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a513"></a>        <span class="src-sym">}</span></li>
<li><a name="a514"></a>    <span class="src-sym">}</span></li>
<li><a name="a515"></a>    </li>
<li><a name="a516"></a>    <span class="src-doc">/**</span></li>
<li><a name="a517"></a><span class="src-doc">     * Write Breaks</span></li>
<li><a name="a518"></a><span class="src-doc">     *</span></li>
<li><a name="a519"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">    </span><span class="src-doc-type">xmlWriter </span><span class="src-doc">                </span><span class="src-doc-var">$objWriter </span><span class="src-doc">        XML Writer</span></li>
<li><a name="a520"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">    </span><span class="src-doc-type">PHPExcel_Worksheet </span><span class="src-doc">       </span><span class="src-doc-var">$pSheet </span><span class="src-doc">           Worksheet</span></li>
<li><a name="a521"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@throws</span><span class="src-doc">     Exception</span></li>
<li><a name="a522"></a><span class="src-doc">     */</span></li>
<li><a name="a523"></a>    <span class="src-key">private </span><span class="src-key">function </span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_Worksheet.html#method_writeBreaks">_writeBreaks</a><span class="src-sym">(</span><span class="src-var">$objWriter </span>= <span class="src-id">null</span><span class="src-sym">, </span><span class="src-var">$pSheet </span>= <span class="src-id">null</span><span class="src-sym">)</span></li>
<li><a name="a524"></a>    <span class="src-sym">{</span></li>
<li><a name="a525"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$objWriter </span>instanceof <span class="src-id">xmlWriter </span>&amp;&amp; <span class="src-var">$pSheet </span>instanceof <span class="src-id"><a href="../PHPExcel/PHPExcel_Worksheet.html">PHPExcel_Worksheet</a></span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a526"></a>            <span class="src-comm">// Get row and column breaks</span></li>
<li><a name="a527"></a>            <span class="src-var">$aRowBreaks </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a528"></a>            <span class="src-var">$aColumnBreaks </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a529"></a>            <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getBreaks</span><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-key">as </span><span class="src-var">$cell </span>=&gt; <span class="src-var">$breakType</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a530"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$breakType </span>== <span class="src-id"><a href="../PHPExcel/PHPExcel_Worksheet.html">PHPExcel_Worksheet</a></span><span class="src-sym">::</span><span class="src-id">BREAK_ROW</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a531"></a>                    <a href="http://www.php.net/array_push">array_push</a><span class="src-sym">(</span><span class="src-var">$aRowBreaks</span><span class="src-sym">, </span><span class="src-var">$cell</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a532"></a>                <span class="src-sym">} </span><span class="src-key">else </span><span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$breakType </span>== <span class="src-id"><a href="../PHPExcel/PHPExcel_Worksheet.html">PHPExcel_Worksheet</a></span><span class="src-sym">::</span><span class="src-id">BREAK_COLUMN</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a533"></a>                    <a href="http://www.php.net/array_push">array_push</a><span class="src-sym">(</span><span class="src-var">$aColumnBreaks</span><span class="src-sym">, </span><span class="src-var">$cell</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a534"></a>                <span class="src-sym">}</span></li>
<li><a name="a535"></a>            <span class="src-sym">}</span></li>
<li><a name="a536"></a>            </li>
<li><a name="a537"></a>            <span class="src-comm">// rowBreaks</span></li>
<li><a name="a538"></a>            <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$aRowBreaks</span><span class="src-sym">) </span>&gt; <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a539"></a>                <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">startElement</span><span class="src-sym">(</span><span class="src-str">'rowBreaks'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a540"></a>                <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'count'</span><span class="src-sym">,             </span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$aRowBreaks</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a541"></a>                <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'manualBreakCount'</span><span class="src-sym">,     </span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$aRowBreaks</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a542"></a>                </li>
<li><a name="a543"></a>                    <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$aRowBreaks </span><span class="src-key">as </span><span class="src-var">$cell</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a544"></a>                        <span class="src-var">$coords </span>= <span class="src-id"><a href="../PHPExcel/PHPExcel_Cell.html">PHPExcel_Cell</a></span><span class="src-sym">::</span><a href="../PHPExcel/PHPExcel_Cell.html#methodcoordinateFromString">coordinateFromString</a><span class="src-sym">(</span><span class="src-var">$cell</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a545"></a>                        </li>
<li><a name="a546"></a>                        <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">startElement</span><span class="src-sym">(</span><span class="src-str">'brk'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a547"></a>                        <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">,     </span><span class="src-var">$coords</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a548"></a>                        <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'man'</span><span class="src-sym">,     </span><span class="src-str">'1'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a549"></a>                        <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">endElement</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a550"></a>                    <span class="src-sym">}</span></li>
<li><a name="a551"></a>                    </li>
<li><a name="a552"></a>                <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">endElement</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a553"></a>            <span class="src-sym">}</span></li>
<li><a name="a554"></a>            </li>
<li><a name="a555"></a>            <span class="src-comm">// Second, write column breaks</span></li>
<li><a name="a556"></a>            <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$aColumnBreaks</span><span class="src-sym">) </span>&gt; <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a557"></a>                <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">startElement</span><span class="src-sym">(</span><span class="src-str">'colBreaks'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a558"></a>                <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'count'</span><span class="src-sym">,             </span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$aColumnBreaks</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a559"></a>                <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'manualBreakCount'</span><span class="src-sym">,     </span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$aColumnBreaks</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a560"></a>                </li>
<li><a name="a561"></a>                    <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$aColumnBreaks </span><span class="src-key">as </span><span class="src-var">$cell</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a562"></a>                        <span class="src-var">$coords </span>= <span class="src-id"><a href="../PHPExcel/PHPExcel_Cell.html">PHPExcel_Cell</a></span><span class="src-sym">::</span><a href="../PHPExcel/PHPExcel_Cell.html#methodcoordinateFromString">coordinateFromString</a><span class="src-sym">(</span><span class="src-var">$cell</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a563"></a>                        </li>
<li><a name="a564"></a>                        <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">startElement</span><span class="src-sym">(</span><span class="src-str">'brk'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a565"></a>                        <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">,     </span><span class="src-id"><a href="../PHPExcel/PHPExcel_Cell.html">PHPExcel_Cell</a></span><span class="src-sym">::</span><a href="../PHPExcel/PHPExcel_Cell.html#methodcolumnIndexFromString">columnIndexFromString</a><span class="src-sym">(</span><span class="src-var">$coords</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">) </span>- <span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a566"></a>                        <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'man'</span><span class="src-sym">,     </span><span class="src-str">'1'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a567"></a>                        <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">endElement</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a568"></a>                    <span class="src-sym">}</span></li>
<li><a name="a569"></a>                    </li>
<li><a name="a570"></a>                <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">endElement</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a571"></a>            <span class="src-sym">}</span></li>
<li><a name="a572"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a573"></a>            throw <span class="src-key">new </span><span class="src-id">Exception</span><span class="src-sym">(</span><span class="src-str">&quot;Invalid parameters passed.&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a574"></a>        <span class="src-sym">}</span></li>
<li><a name="a575"></a>    <span class="src-sym">}</span></li>
<li><a name="a576"></a>    </li>
<li><a name="a577"></a>    <span class="src-doc">/**</span></li>
<li><a name="a578"></a><span class="src-doc">     * Write SheetData</span></li>
<li><a name="a579"></a><span class="src-doc">     *</span></li>
<li><a name="a580"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">    </span><span class="src-doc-type">xmlWriter </span><span class="src-doc">                </span><span class="src-doc-var">$objWriter </span><span class="src-doc">        XML Writer</span></li>
<li><a name="a581"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">    </span><span class="src-doc-type">PHPExcel_Worksheet </span><span class="src-doc">   </span><span class="src-doc-var">$pSheet </span><span class="src-doc">           Worksheet</span></li>
<li><a name="a582"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">    </span><span class="src-doc-type">string[] </span><span class="src-doc">               </span><span class="src-doc-var">$pStringTable </span><span class="src-doc">   String table</span></li>
<li><a name="a583"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@throws</span><span class="src-doc">     Exception</span></li>
<li><a name="a584"></a><span class="src-doc">     */</span></li>
<li><a name="a585"></a>    <span class="src-key">private </span><span class="src-key">function </span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_Worksheet.html#method_writeSheetData">_writeSheetData</a><span class="src-sym">(</span><span class="src-var">$objWriter </span>= <span class="src-id">null</span><span class="src-sym">, </span><span class="src-var">$pSheet </span>= <span class="src-id">null</span><span class="src-sym">, </span><span class="src-var">$pStringTable </span>= <span class="src-id">null</span><span class="src-sym">)</span></li>
<li><a name="a586"></a>    <span class="src-sym">{</span></li>
<li><a name="a587"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$objWriter </span>instanceof <span class="src-id">xmlWriter </span>&amp;&amp; <span class="src-var">$pSheet </span>instanceof <span class="src-id"><a href="../PHPExcel/PHPExcel_Worksheet.html">PHPExcel_Worksheet</a> </span>&amp;&amp; <a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$pStringTable</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a588"></a>            <span class="src-comm">// Flipped stringtable, for faster index searching</span></li>
<li><a name="a589"></a>            <span class="src-var">$aFlippedStringTable </span>= <a href="http://www.php.net/array_flip">array_flip</a><span class="src-sym">(</span><span class="src-var">$pStringTable</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a590"></a>            </li>
<li><a name="a591"></a>            <span class="src-comm">// sheetData</span></li>
<li><a name="a592"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">startElement</span><span class="src-sym">(</span><span class="src-str">'sheetData'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a593"></a>&nbsp;</li>
<li><a name="a594"></a>                <span class="src-comm">// Get column count</span></li>
<li><a name="a595"></a>                <span class="src-var">$colCount </span>= <span class="src-id"><a href="../PHPExcel/PHPExcel_Cell.html">PHPExcel_Cell</a></span><span class="src-sym">::</span><a href="../PHPExcel/PHPExcel_Cell.html#methodcolumnIndexFromString">columnIndexFromString</a><span class="src-sym">(</span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getHighestColumn</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a596"></a>            </li>
<li><a name="a597"></a>                <span class="src-comm">// Loop trough cells</span></li>
<li><a name="a598"></a>                <span class="src-var">$currentRow </span>= -<span class="src-num">1</span><span class="src-sym">;</span></li>
<li><a name="a599"></a>                <span class="src-var">$cellCollection </span>= <span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getCellCollection</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a600"></a>                <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$cellCollection </span><span class="src-key">as </span><span class="src-var">$cell</span><span class="src-sym">) </span><span class="src-sym">{                    </span></li>
<li><a name="a601"></a>                    <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$currentRow </span>!= <span class="src-var">$cell</span><span class="src-sym">-&gt;</span><span class="src-id">getRow</span><span class="src-sym">(</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a602"></a>                        <span class="src-comm">// End previous row?</span></li>
<li><a name="a603"></a>                        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$currentRow </span>!= -<span class="src-num">1</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a604"></a>                            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">endElement</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a605"></a>                        <span class="src-sym">}</span></li>
<li><a name="a606"></a>&nbsp;</li>
<li><a name="a607"></a>                        <span class="src-comm">// Set current row</span></li>
<li><a name="a608"></a>                        <span class="src-var">$currentRow </span>= <span class="src-var">$cell</span><span class="src-sym">-&gt;</span><span class="src-id">getRow</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a609"></a>&nbsp;</li>
<li><a name="a610"></a>                        <span class="src-comm">// Get row dimension</span></li>
<li><a name="a611"></a>                        <span class="src-var">$rowDimension </span>= <span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getRowDimension</span><span class="src-sym">(</span><span class="src-var">$currentRow</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a612"></a>            </li>
<li><a name="a613"></a>                        <span class="src-comm">// Start a new row</span></li>
<li><a name="a614"></a>                        <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">startElement</span><span class="src-sym">(</span><span class="src-str">'row'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a615"></a>                        <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'r'</span><span class="src-sym">,     </span><span class="src-var">$currentRow</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a616"></a>                        <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'spans'</span><span class="src-sym">,    </span><span class="src-str">'1:' </span>. <span class="src-var">$colCount</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a617"></a>                                    </li>
<li><a name="a618"></a>                        <span class="src-comm">// Row dimensions</span></li>
<li><a name="a619"></a>                        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$rowDimension</span><span class="src-sym">-&gt;</span><span class="src-id">getRowHeight</span><span class="src-sym">(</span><span class="src-sym">) </span>&gt;= <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a620"></a>                            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'customHeight'</span><span class="src-sym">,     </span><span class="src-str">'1'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a621"></a>                            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'ht'</span><span class="src-sym">,             </span><span class="src-var">$rowDimension</span><span class="src-sym">-&gt;</span><span class="src-id">getRowHeight</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a622"></a>                        <span class="src-sym">}</span></li>
<li><a name="a623"></a>                    <span class="src-sym">}</span></li>
<li><a name="a624"></a>                    </li>
<li><a name="a625"></a>                    <span class="src-comm">// Write cell</span></li>
<li><a name="a626"></a>                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_Worksheet.html#method_writeCell">_writeCell</a><span class="src-sym">(</span><span class="src-var">$objWriter</span><span class="src-sym">, </span><span class="src-var">$pSheet</span><span class="src-sym">, </span><span class="src-var">$cell</span><span class="src-sym">, </span><span class="src-var">$pStringTable</span><span class="src-sym">, </span><span class="src-var">$aFlippedStringTable</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a627"></a>                <span class="src-sym">}</span></li>
<li><a name="a628"></a>&nbsp;</li>
<li><a name="a629"></a>                <span class="src-comm">// End last row?</span></li>
<li><a name="a630"></a>                <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$currentRow </span>!= -<span class="src-num">1</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a631"></a>                    <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">endElement</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a632"></a>                <span class="src-sym">}</span></li>
<li><a name="a633"></a>                    </li>
<li><a name="a634"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">endElement</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a635"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a636"></a>            throw <span class="src-key">new </span><span class="src-id">Exception</span><span class="src-sym">(</span><span class="src-str">&quot;Invalid parameters passed.&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a637"></a>        <span class="src-sym">}</span></li>
<li><a name="a638"></a>    <span class="src-sym">}</span></li>
<li><a name="a639"></a>    </li>
<li><a name="a640"></a>    <span class="src-doc">/**</span></li>
<li><a name="a641"></a><span class="src-doc">     * Write Cell</span></li>
<li><a name="a642"></a><span class="src-doc">     *</span></li>
<li><a name="a643"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">    </span><span class="src-doc-type">xmlWriter </span><span class="src-doc">                </span><span class="src-doc-var">$objWriter </span><span class="src-doc">                XML Writer</span></li>
<li><a name="a644"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">    </span><span class="src-doc-type">PHPExcel_Worksheet </span><span class="src-doc">   </span><span class="src-doc-var">$pSheet </span><span class="src-doc">                   Worksheet</span></li>
<li><a name="a645"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">    </span><span class="src-doc-type">PHPExcel_Cell </span><span class="src-doc">       </span><span class="src-doc-var">$pCell </span><span class="src-doc">                   Cell</span></li>
<li><a name="a646"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">    </span><span class="src-doc-type">string[] </span><span class="src-doc">               </span><span class="src-doc-var">$pStringTable </span><span class="src-doc">           String table</span></li>
<li><a name="a647"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">    </span><span class="src-doc-type">string[] </span><span class="src-doc">               </span><span class="src-doc-var">$pFlippedStringTable </span><span class="src-doc">   String table (flipped), for faster index searching</span></li>
<li><a name="a648"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@throws</span><span class="src-doc">     Exception</span></li>
<li><a name="a649"></a><span class="src-doc">     */</span></li>
<li><a name="a650"></a>    <span class="src-key">private </span><span class="src-key">function </span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_Worksheet.html#method_writeCell">_writeCell</a><span class="src-sym">(</span><span class="src-var">$objWriter </span>= <span class="src-id">null</span><span class="src-sym">, </span><span class="src-var">$pSheet </span>= <span class="src-id">null</span><span class="src-sym">, </span><span class="src-var">$pCell </span>= <span class="src-id">null</span><span class="src-sym">, </span><span class="src-var">$pStringTable </span>= <span class="src-id">null</span><span class="src-sym">, </span><span class="src-var">$pFlippedStringTable </span>= <span class="src-id">null</span><span class="src-sym">)</span></li>
<li><a name="a651"></a>    <span class="src-sym">{</span></li>
<li><a name="a652"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$objWriter </span>instanceof <span class="src-id">xmlWriter </span>&amp;&amp; <span class="src-var">$pSheet </span>instanceof <span class="src-id"><a href="../PHPExcel/PHPExcel_Worksheet.html">PHPExcel_Worksheet</a> </span>&amp;&amp; <span class="src-var">$pCell </span>instanceof <span class="src-id"><a href="../PHPExcel/PHPExcel_Cell.html">PHPExcel_Cell</a> </span>&amp;&amp; <a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$pStringTable</span><span class="src-sym">) </span>&amp;&amp; <a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$pFlippedStringTable</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a653"></a>            <span class="src-comm">// Cell</span></li>
<li><a name="a654"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">startElement</span><span class="src-sym">(</span><span class="src-str">'c'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a655"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'r'</span><span class="src-sym">, </span><span class="src-var">$pCell</span><span class="src-sym">-&gt;</span><span class="src-id">getCoordinate</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a656"></a>            </li>
<li><a name="a657"></a>            <span class="src-comm">// Sheet styles</span></li>
<li><a name="a658"></a>            <span class="src-var">$aStyles </span>= <span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getStyles</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a659"></a>            <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$aStyles</span><span class="src-sym">[</span><span class="src-var">$pCell</span><span class="src-sym">-&gt;</span><span class="src-id">getCoordinate</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a660"></a>                <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'s'</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_WriterPart.html#methodgetParentWriter">getParentWriter</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getStylesHashTable</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getIndexForHashCode</span><span class="src-sym">( </span><span class="src-var">$aStyles</span><span class="src-sym">[</span><span class="src-var">$pCell</span><span class="src-sym">-&gt;</span><span class="src-id">getCoordinate</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getHashCode</span><span class="src-sym">(</span><span class="src-sym">) ))</span><span class="src-sym">;</span></li>
<li><a name="a661"></a>            <span class="src-sym">}</span></li>
<li><a name="a662"></a>            </li>
<li><a name="a663"></a>            <span class="src-comm">// If cell value is supplied, write cell value</span></li>
<li><a name="a664"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$pCell</span><span class="src-sym">-&gt;</span><span class="src-id">getValue</span><span class="src-sym">(</span><span class="src-sym">) </span>!= <span class="src-str">''</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a665"></a>                <span class="src-comm">// Map type</span></li>
<li><a name="a666"></a>                <span class="src-var">$mappedType </span>= <span class="src-var">$pCell</span><span class="src-sym">-&gt;</span><span class="src-id">getDataType</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a667"></a>                                </li>
<li><a name="a668"></a>                <span class="src-comm">// Write data type depending on its type</span></li>
<li><a name="a669"></a>                <span class="src-key">switch </span><span class="src-sym">(</span><a href="http://www.php.net/strtolower">strtolower</a><span class="src-sym">(</span><span class="src-var">$mappedType</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a670"></a>                    <span class="src-key">case </span><span class="src-str">'s'</span>:     <span class="src-comm">// String</span></li>
<li><a name="a671"></a>                        <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'t'</span><span class="src-sym">, </span><span class="src-var">$mappedType</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a672"></a>                        <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a673"></a>                    <span class="src-key">case </span><span class="src-str">'b'</span>:     <span class="src-comm">// Boolean</span></li>
<li><a name="a674"></a>                        <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'t'</span><span class="src-sym">, </span><span class="src-var">$mappedType</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a675"></a>                        <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a676"></a>                    <span class="src-key">case </span><span class="src-str">'f'</span>:     <span class="src-comm">// Formula</span></li>
<li><a name="a677"></a>                        <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'t'</span><span class="src-sym">, </span><span class="src-str">'str'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a678"></a>                        <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a679"></a>                <span class="src-sym">}</span></li>
<li><a name="a680"></a>                                    </li>
<li><a name="a681"></a>                <span class="src-comm">// Write data depending on its type</span></li>
<li><a name="a682"></a>                <span class="src-key">switch </span><span class="src-sym">(</span><a href="http://www.php.net/strtolower">strtolower</a><span class="src-sym">(</span><span class="src-var">$mappedType</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a683"></a>                    <span class="src-key">case </span><span class="src-str">'s'</span>:     <span class="src-comm">// String</span></li>
<li><a name="a684"></a>                        <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeElement</span><span class="src-sym">(</span><span class="src-str">'v'</span><span class="src-sym">, </span><span class="src-var">$pFlippedStringTable</span><span class="src-sym">[</span><span class="src-var">$pCell</span><span class="src-sym">-&gt;</span><span class="src-id">getValue</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">; </span><span class="src-comm">//array_search($pCell-&gt;getValue(), $pStringTable));</span></li>
<li><a name="a685"></a>                        <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a686"></a>                    <span class="src-key">case </span><span class="src-str">'f'</span>:     <span class="src-comm">// Formula</span></li>
<li><a name="a687"></a>                        <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeElement</span><span class="src-sym">(</span><span class="src-str">'f'</span><span class="src-sym">, </span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$pCell</span><span class="src-sym">-&gt;</span><span class="src-id">getValue</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">, </span><span class="src-num">1</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a688"></a>                        <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a689"></a>                    <span class="src-key">case </span><span class="src-str">'n'</span>:     <span class="src-comm">// Numeric</span></li>
<li><a name="a690"></a>                        <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeElement</span><span class="src-sym">(</span><span class="src-str">'v'</span><span class="src-sym">, </span><span class="src-var">$pCell</span><span class="src-sym">-&gt;</span><span class="src-id">getValue</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a691"></a>                        <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a692"></a>                    <span class="src-key">case </span><span class="src-str">'b'</span>:     <span class="src-comm">// Boolean</span></li>
<li><a name="a693"></a>                        <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeElement</span><span class="src-sym">(</span><span class="src-str">'v'</span><span class="src-sym">, </span><span class="src-sym">(</span><span class="src-var">$pCell</span><span class="src-sym">-&gt;</span><span class="src-id">getValue</span><span class="src-sym">(</span><span class="src-sym">) </span>? <span class="src-str">'1' </span>: <span class="src-str">'0'</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a694"></a>                        <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a695"></a>                <span class="src-sym">}</span></li>
<li><a name="a696"></a>            <span class="src-sym">}</span></li>
<li><a name="a697"></a>&nbsp;</li>
<li><a name="a698"></a>            <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">endElement</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a699"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a700"></a>            throw <span class="src-key">new </span><span class="src-id">Exception</span><span class="src-sym">(</span><span class="src-str">&quot;Invalid parameters passed.&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a701"></a>        <span class="src-sym">}</span></li>
<li><a name="a702"></a>    <span class="src-sym">}</span></li>
<li><a name="a703"></a>    </li>
<li><a name="a704"></a>    <span class="src-doc">/**</span></li>
<li><a name="a705"></a><span class="src-doc">     * Write Drawings</span></li>
<li><a name="a706"></a><span class="src-doc">     *</span></li>
<li><a name="a707"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">    </span><span class="src-doc-type">xmlWriter </span><span class="src-doc">                </span><span class="src-doc-var">$objWriter </span><span class="src-doc">        XML Writer</span></li>
<li><a name="a708"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@param </span><span class="src-doc">    </span><span class="src-doc-type">PHPExcel_Worksheet </span><span class="src-doc">   </span><span class="src-doc-var">$pSheet </span><span class="src-doc">           Worksheet</span></li>
<li><a name="a709"></a><span class="src-doc">     * </span><span class="src-doc-coretag">@throws</span><span class="src-doc">     Exception</span></li>
<li><a name="a710"></a><span class="src-doc">     */</span></li>
<li><a name="a711"></a>    <span class="src-key">private </span><span class="src-key">function </span><a href="../PHPExcel_Writer_Excel2007/PHPExcel_Writer_Excel2007_Worksheet.html#method_writeDrawings">_writeDrawings</a><span class="src-sym">(</span><span class="src-var">$objWriter </span>= <span class="src-id">null</span><span class="src-sym">, </span><span class="src-var">$pSheet </span>= <span class="src-id">null</span><span class="src-sym">)</span></li>
<li><a name="a712"></a>    <span class="src-sym">{</span></li>
<li><a name="a713"></a>        <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$objWriter </span>instanceof <span class="src-id">xmlWriter </span>&amp;&amp; <span class="src-var">$pSheet </span>instanceof <span class="src-id"><a href="../PHPExcel/PHPExcel_Worksheet.html">PHPExcel_Worksheet</a></span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a714"></a>            <span class="src-comm">// If sheet contains drawings, add the relationships</span></li>
<li><a name="a715"></a>            <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$pSheet</span><span class="src-sym">-&gt;</span><span class="src-id">getDrawingCollection</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">count</span><span class="src-sym">(</span><span class="src-sym">) </span>&gt; <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a716"></a>                <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">startElement</span><span class="src-sym">(</span><span class="src-str">'drawing'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a717"></a>                <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">writeAttribute</span><span class="src-sym">(</span><span class="src-str">'r:id'</span><span class="src-sym">, </span><span class="src-str">'rId1'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a718"></a>                <span class="src-var">$objWriter</span><span class="src-sym">-&gt;</span><span class="src-id">endElement</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a719"></a>            <span class="src-sym">}            </span></li>
<li><a name="a720"></a>        <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a721"></a>            throw <span class="src-key">new </span><span class="src-id">Exception</span><span class="src-sym">(</span><span class="src-str">&quot;Invalid parameters passed.&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a722"></a>        <span class="src-sym">}</span></li>
<li><a name="a723"></a>    <span class="src-sym">}</span></li>
<li><a name="a724"></a><span class="src-sym">}</span></li>
</ol></pre></div>
</div>
        <div class="credit">
		    <hr />
		    Documentation generated on Mon, 23 Apr 2007 12:57:20 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.3.0RC3</a>
	      </div>
      </td></tr></table>
    </td>
  </tr>
</table>

</body>
</html>